import axios from 'axios'
import rps from '@/utils/local_modules/responseOperation'
import res from '@/utils/local_modules/requestOperation'
const service = axios.create()

// 响应拦截器
service.interceptors.response.use(response => {
  response.data = rps.responseHandling(response.data)
  return response.data
})
// 请求拦截器
service.interceptors.request.use(
  config => {
    config = res.requestHandling(config)
    return config
  },
  error => {
    return Promise.error(error)
  }
)
export default service
